<?php
namespace User\Model;
use Think\Model;

class LotteryModel extends Model
{
    CONST ZHONGJIANG_ACTIVE = 1;//中奖
    CONST ZHONGJIANG_DELETE = 9;//未中奖

    CONST ITEM_ACTIVE = 1;//奖项正常
    CONST ITEM_DELETE = 9;//奖项已删除

    CONST AWARD_ACTIVE = 1;//奖项正常
    CONST AWARD_CHECKED = 2;//奖项已核销
    CONST AWARD_DELETE = 9;//奖项已删除

    CONST FANS_ACTIVE = 1;//粉丝正常
    CONST FANS_DELETE = 9;//粉丝已删除

    CONST STATUS_ACTIVE = 1;//正常、已发布
    CONST STATUS_STOP = 2;//已停用
    CONST STATUS_DELETE = 9;//已删除

    CONST FOLLOW_YES = 1;//强制关注是
    CONST FOLLOW_NO = 9;//强制关注否

    CONST CUSTOM_CODE = 1;//关注二维码
    CONST CUSTOM_LINK = 2;//跳转地址

    CONST LOTTERY_NORMAL = 1;//普通次数类型
    CONST LOTTERY_SHARE = 2;//分享奖励次数类型

    CONST LEVEL1 = '一等奖';
    CONST LEVEL2 = '二等奖';
    CONST LEVEL3 = '三等奖';
    CONST LEVEL4 = '四等奖';
    CONST LEVEL5 = '五等奖';
    CONST LEVEL6 = '六等奖';
    CONST LEVEL7 = '七等奖';
    CONST LEVEL8 = '八等奖';
    CONST LEVEL9 = '九等奖';
    CONST LEVEL10 = '十等奖';
    CONST LEVEL11 = '特等奖';
    CONST LEVEL12 = '安慰奖';

    public static function getLevel($level = 'all')
    {
        $levelArr = [
            1 => self::LEVEL1,
            2 => self::LEVEL2,
            3 => self::LEVEL3,
            4 => self::LEVEL4,
            5 => self::LEVEL5,
            6 => self::LEVEL6,
            7 => self::LEVEL7,
            8 => self::LEVEL8,
            9 => self::LEVEL9,
            10 => self::LEVEL10,
            11 => self::LEVEL11,
            12 => self::LEVEL12,
        ];
        if ($level == 'all') {
            return $levelArr;
        }
        if (array_key_exists($level, $levelArr)) {
            return $levelArr[$level];
        }
        return "未知";
    }
}
?>